Pl
D
Jo)
b4
)
CH
A
File Edit Selection View Go Debug Terminal Help update-hash
EXPLORER: PROJECT ¢ @l
e
> m gt
N
R
P EIETES
P EEe
FIR e
R Te Y
| FEEEE
[ LN
CR R SRS =
R SR
= README.rst
BTNV
BT R
| PR O e e
[ release-sr
€ schemajson
Py
EICER R RN
Bpupdate-hash
| PSR
I update-rc
i validate-schema
[P
update-hash- [l update-hash siapos recently opened
Setas interpreter B update-hash-mergetool siapos
#1/usr/bin/er e README.update-hash.rst slapos LICYEETTS
Suggested installation:
cp update-hash .git/hooks/
$EDITOR .git/hooks/pre-commit
#!/bin/bash
B
9 touch "$(git rev-parse --git-dir)/hooks/.need-post-commit"
i
x
g
I
5
6 $
7
-3
b
jsi $
$EDITOR .git/hooks/post-commit
12 #!/bin/bash
s oEE =2
14 MARKER="$(git rev-parse --git-dir)/hooks/.need-post-commi:
S UPDATE_HASH="$(git rev-parse --git-dir)/hooks/update-hash"
1 if [ -e "$MARKER" -a -x "$UPDATE HASH" ]; then
17 L I IR
18 if git diff-index --quiet HEAD -- ; then
pil # nothing
pil '
20 &
22 git stash save --keep-index --quiet "update-hash pre-commit hook"
23 trap "git stash pop" EXIT
24 L
s find "$(git rev-parse --show-toplevel)" -name "buildout.hash.cfg" | while IFS= read -r HASHFILE; do
P "$UPDATE_HASH" "$HASHFILE"
i git add "$HASHFILE"
28 done
pil git commit --amend --no-verify -C HEAD
30 Lt
i
EZ3 BEWARE: rebasing does not trigger this hook, so you have to commit each
33 change explicitely. Improvements welcome.
EL e
35 import hashlib
EL pLL T g a1
37 import shutil
38 import sys
39 import tempfile